'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;

  // router.get('/', controller.home.index);

  // router.get('/api/getuser', controller.user.index);

  // 获取问答首页是否付款
  router.get('/api/mjtquestion', controller.mjtquestion.index);
  router.put('/api/mjtquestion/:id', controller.mjtquestion.update);
  // 提问
  router.get('/api/mjtspeak', controller.mjtspeak.index);
  router.get('/api/mjtspeak/uid/:uid', controller.mjtspeak.index0);
  router.get('/api/mjtspeak/isopen/:isopen', controller.mjtspeak.index00);
  router.post('/api/mjtspeak', controller.mjtspeak.create);
  router.put('/api/mjtspeak/:id', controller.mjtspeak.update);
  // 搜索历史
  router.get('/api/mjtsearchhistory', controller.mjtsearchhistory.index);
  router.delete('/api/mjtsearchhistory/:id', controller.mjtsearchhistory.destroy);
  router.post('/api/mjtsearchhistory', controller.mjtsearchhistory.create);
  // 热门搜索
  router.get('/api/mjthotsearch', controller.mjthotsearch.index);
  // 医生列表
  router.get('/api/mjtdoctor', controller.mjtdoctor.index);
  router.get('/api/mjtdoctor/id/:id', controller.mjtdoctor.show);
  router.get('/api/mjtdoctor/fenlei/:fenlei', controller.mjtdoctor.index0);
  router.get('/api/mjtdoctor/doctorFenlei/:doctorFenlei', controller.mjtdoctor.index00);
  router.get('/api/mjtdoctor/doctorName/:doctorName', controller.mjtdoctor.index000);
  // 关注列表
  router.get('/api/mjtguanzhu', controller.mjtguanzhu.index);
  router.post('/api/mjtguanzhu', controller.mjtguanzhu.create);
  router.get('/api/mjtguanzhu/:uid', controller.mjtguanzhu.index0);
  router.delete('/api/mjtguanzhu/:id', controller.mjtguanzhu.destroy);
  // router.get('/api/addWYLuser', controller.user.index); // 获取
  // router.post('/api/addWYLuser', controller.user.create); // 创建
  // router.delete('/api/delWYLuser/:id', controller.user.destroy); // 删除
  // router.put('/api/upWYLuser/:id', controller.user.update); // 更新
  // router.get('/aprouter.get('/api/getWYLuser23/:age', controller.user.index0);i/getWYLuser2/:id', controller.user.show); // 查找
  //  // 查找

  router.get('/api/getchoice', controller.whjchoice.index);
  // 孕期培训
  router.get('/api/getrain', controller.whjtrain.index);
  router.get('/api/getoffline', controller.whjoffline.index);
  router.get('/api/gettutor/:name', controller.whjtutor.index0); // 查找
  router.get('/api/gettutor1/:teacherid', controller.whjtutor.index1); // 查找
  router.get('/api/gettutor2/:idnum', controller.whjtutor.index2); // 查找
  router.get('/api/gettutor3/:region', controller.whjtutor.index3); // 查找
  router.get('/api/gettutorList', controller.whjtutor.index);
  router.get('/api/searchtutor/:id', controller.whjtutor.show); // 查找
  router.put('/api/upoffline/:id', controller.whjoffline.update);
  router.get('/api/seoffline/:id', controller.whjoffline.show); // 查找


  router.get('/api/getpsxsonal', controller.psxsonal.index);// 获取个人信息
  router.post('/api/addpsxsonal', controller.psxsonal.create); // 创建个人信息
  router.get('/api/getpsxtutor', controller.pxtutor.index);// 获取知名导师信息
  router.get('/api/getpsxapply', controller.psxapply.index);// 获取问答个人信息
  router.post('/api/addpsxapply', controller.psxapply.create); // 创建问答个人信息
  router.get('/api/getpsxdata', controller.psxdata.index);// 获取个人信息
  router.put('/api/putpsxdata/:id', controller.psxdata.update);// 更新 签到
  router.get('/api/getpsxintegral', controller.psxintegral.index);// 获取积分信息
  router.get('/api/getpsxpsxdetil', controller.psxdetil.index);// 获取积分明细信息
  router.put('/api/putpsxintegral/:id', controller.psxintegral.update);// 更新积分信息
  router.post('/api/addpsxdetil', controller.psxdetil.create); // 创建积分信息
  // router.delete('/api/delWYLpsxsonal/:id', controller.psxsonal.destroy); // 删除
  // router.put('/api/upWYLpsxsonal/:id', controller.psxsonal.update);
  router.get('/api/psxdetil/:id', controller.psxdetil.show); // 查找 积分明细
  // router.get('/api/getWYLpsxsonal23/:age', controller.psxsonal.index0); // 查找


  router.get('/api/lfycourse', controller.lfycourse.index)
  router.get('/api/lfycoursetopic', controller.lfycoursetopic.index)
  router.get('/api/lfycoursediscuss', controller.lfycoursediscuss.index);
  router.post('/api/lfyadddiscuss', controller.lfycoursediscuss.create)// 发布话题
  router.get('/api/lfycoursediscuss/:id', controller.lfycoursediscuss.show) // 查找讨论
  // router.get('/api/lfysearchdiscuss/:id', controller.lfycoursediscuss.show) // 查找讨论
  router.get('/api/lfyanswer', controller.lfyanswer.index)
  router.get('/api/lfyanswer/:id', controller.lfyanswer.show) // 查找回答
  router.post('/api/lfyaddanswer', controller.lfyanswer.create) // 添加回答
  router.put('/api/lfythumbanswer/:id', controller.lfyanswer.update) // 点赞
  router.get('/api/lfyanswerdis', controller.lfyanswerdis.index)
  router.post('/api/lfyaddanswerdis', controller.lfyanswerdis.create) // 回答评论
  router.put('/api/lfythumbdis/:id', controller.lfyanswerdis.update) // 评论点赞
  router.get('/api/lfycoursepj', controller.lfycoursepj.index)
  router.post('/api/lfyaddpj', controller.lfycoursepj.create) // 添加回答
};
